{{--前台详情页--}}
@extends('orange.layouts.indexPublic')
@section('title'){{ $info->title.'兼职'.(empty($info->need_num)?'若干':$info->need_num).'名_'.$info->companyBasic->company_name.'_'.Site::get('webname') }} @endsection
{{--兼职详情页css--}}
@section('headcss')
    <meta name="keywords" content="{{Site::get('homekeywords')}}">
    <meta name="description" content="{{Site::get('homedescription')}}">
    @parent
    <link rel="stylesheet" href="{{asset('/orange/css/part_time/show.css')}}">
@endsection

{{--主体内容--}}
@section('content')
    {{--logo、搜索栏--}}
    <div class="logoAndSearch">
        <div class="wrapper">
            <h1 class="logo">
                <a href="{{url('/')}}">
                    <img src="{{asset('default/images/logo/jz_logo.png')}}" alt="兼职logo">
                </a>
            </h1>
        </div>
    </div>
    {{--logo、搜索栏结束--}}

    {{--职位信息及侧边下载框--}}
    <div class="main">
        <div class="wrapper">
            <div class="jobInfo">
                {{--基本信息--}}
                <div class="baseInfo">
                    <h2><span>{{$info->title}}</span><span class="date">{{$info->updated_at}}</span></h2>
                    <div class="salary"><span>{{$info->salary_price}}{{$info->salary_unit_name}}</span><span
                                class="vline"></span><span>{{$info->salary_method_name}}</span></div>
                    <div id="allmap"></div>
                    <ul>
                        <li>
                            <span class="name">招聘人数</span><span>@if($info->need_num==0){!! '若干' !!}@else{{$info->need_num}}@endif
                                人</span></li>
                        <li><span class="name">工作区域</span><span>{{$info->city_address}}</span></li>
                        <li>
                            <span class="name">工作地址</span><span>{{$info->address}}</span>
                            @if($info->longitude)<a id="seeMap" href="javascript:void(0)">查看地图</a>@endif
                        </li>
                        <li><span class="name">有效期限</span><span>{{$info->pt_time_string}}</span></li>
                    </ul>
                    <table>
                        <tr class="title">
                            <td></td>
                            <td>星期一</td>
                            <td>星期二</td>
                            <td>星期三</td>
                            <td>星期四</td>
                            <td>星期五</td>
                            <td>星期六</td>
                            <td>星期七</td>
                        <tr>
                            {{--isWork:表示工作日--}}
                            <td>上午</td>
                            <td class="@if($info->free_time_list->num1==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num4==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num7==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num10==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num13==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num16==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num19==1){!! 'isWork' !!}@endif"></td>
                        </tr>
                        <tr>
                            <td>下午</td>
                            <td class="@if($info->free_time_list->num2==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num5==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num8==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num11==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num14==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num17==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num20==1){!! 'isWork' !!}@endif"></td>
                        <tr>
                            <td>晚上</td>
                            <td class="@if($info->free_time_list->num3==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num6==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num9==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num12==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num15==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num18==1){!! 'isWork' !!}@endif"></td>
                            <td class="@if($info->free_time_list->num21==1){!! 'isWork' !!}@endif"></td>
                        </tr>
                    </table>
                </div>
                {{--基本信息结束--}}
                {{--详情--}}
                <div class="details">
                    {{--发布人--}}
                    <h2><span>发布人</span></h2>
                    <div class="publisher">
                        <div class="left">{{msubstr($info->contacts,0,1,'utf-8',false)}}</div>{{--姓氏--}}
                        <div class="right">
                            <p class="p1">发布人：{{stringHideCut($info->contacts)}}</p>
                            <p class="p2">{{stringHideCut($info->mobile)}}
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{stringHideCut($info->phone_show)}}</p>
                        </div>
                        <button class="apply" id="apply">
                            @if($app['person_ios'] == 1 && $app['person_android'] == 1)
                                {!! '申请兼职' !!}
                            @else
                                {!! '查看联系方式' !!}
                            @endif
                        </button>
                    </div>
                    {{--工作描述--}}
                    <h2><span>工作描述</span></h2>
                    <div class="jobDescribe">
                        <p>学历要求：{{$info->education_name}}</p>
                        <p>性别要求：{{$info->sex_name}}</p>
                        <p>岗位职责：</p>
                        <p>{{$info->content}}</p>
                    </div>
                    {{--企业简介--}}
                    <h2><span>企业简介</span></h2>
                    <div class="compInfo">
                        <p>{{$companyInfo->profile}}</p>
                    </div>
                </div>
                {{--详情结束--}}
            </div>

            {{--右侧浮动框--}}
            <div class="rightAside">
                {{--公司信息--}}
                <div class="company">
                    <div class="companyLogo"><img src="{{$companyInfo->logo}}" width="78" height="78" alt="公司logo"></div>
                    <div class="name">
                        <p><span>{{$companyInfo->company_name}}</span><i @if($companyInfo->cert_status != 1) class="noCertificate" @endif></i></p>
                    </div>
                    <ul>
                        <li><span>行业</span>{{str_limit($companyInfo->industry,24)}}</li>
                        <li><span>性质</span>{{$companyInfo->comkind}}</li>
                        <li><span>规模</span>{{$companyInfo->employee_num}}</li>
                    </ul>
                </div>
                {{--下载二维码--}}
                @include('default.part_time.index.aside')
            </div>
            {{--右侧浮动框结束--}}
        </div>
    </div>
    {{--职位信息及侧边下载框结束--}}
@endsection
{{--兼职详情页js--}}
@section('js')
    @parent
    <script type="text/javascript">
        $(function () {
            //参数
            var hasIOS = '{{$app['person_ios']}}';
            var hasAndroid = '{{$app['person_android']}}';
            var contacts = '{{$info->contacts}}';
            var mobile = '{{$info->mobile}}';
            var phone_show = '{{$info->phone}}';
            //查看地图按钮
            $('#seeMap').click(function () {
                layer.open({
                    type: 2,
                    title: '查看路线',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['910px', '680px'],
                    content: '{{url('pt/traffic?id='.$info->id)}}' //iframe的url
                });
            });
            //申请兼职按钮
            $('#apply').click(function () {
                if (hasIOS == 1 && hasAndroid == 1) {
                    layerShowHasAPP();
                } else {
                    layerShowNoAPPHasLogin();
                }
            });
            //有APP下的弹窗
            function layerShowHasAPP() {
                layer.open({
                    type: 1,
                    title: '请用手机扫描二维码下载',
                    skin: 'layui-layer-apply',
                    area: ['560px', ''], //宽高
                    closeBtn: 0, //取消右上角关闭按钮
                    btn: ['关闭'],
                    content: '<div class="box">' +
                    '<img src="/default/images/logo/code_ios.png" width="200" height="200" alt="兼职ios版下载二维码">' +
                    '<span>IOS版下载</span>' +
                    '</div>' +
                    '<div class="box">' +
                    '<img src="/default/images/logo/code_android.png" width="200" height="200" alt="兼职android版下载二维码">' +
                    '<span>Android版下载</span>' +
                    '</div>' +
                    '<p><strong>说明</strong>：请在APP兼职频道搜索:“&nbsp;<span style="color: #ff9731">' + '{{$info->id}}' + '</span>&nbsp;”即可找到该兼职</p>'
                });
            }

            //没有APP下的已登录弹窗
            function layerShowNoAPPHasLogin() {
                layer.open({
                    type: 1,
                    title: '查看联系方式',
                    skin: 'layui-layer-apply',
                    area: ['560px', ''], //宽高
                    closeBtn: 0, //取消右上角关闭按钮
                    btn: ['关闭'],
                    content: '<p class="p1">发布人：' + contacts + '</p>' +
                    '<p class="p2">联系电话：' + mobile + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + phone_show + '</p>'
                });
            }
        });
    </script>
@endsection